package com.wyj.task;

import com.wyj.common.ApplicationContestProvider;
import com.wyj.common.LogPortal;
import com.wyj.service.HappyRankService;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class HappyRankInfoTask implements Runnable {

    private String uuid;
    private int points;

    @Override
    public void run() {
        LogPortal.info(getClass().getSimpleName() + " start save order info");
        // 调用存库的操作 将上诉的信息进行存库
        try {
            HappyRankService rankService = ApplicationContestProvider.getBean(HappyRankService.class);
            rankService.createVoucherOrder(uuid, points);
        } catch (Exception e) {
            LogPortal.error(getClass().getSimpleName() + " oderInfo save error!!!", e);
        }
    }
}
